<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>GetMenuItemState</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">GetMenuItemState()</font></b></p>
<p><b>语法</b></p><blockquote>

Result = <font color="#3A3966"><b>GetMenuItemState</b></font>(#Menu, MenuItem)</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Returns the checkbox state of a menu item. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Menu</i></td>
<td width="90%"> 
 
The menu to use. 

 

</td></tr>
<tr><td><i>MenuItem</i></td>
<td> 
 
The menu item number to get the state of. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>



Returns nonzero if the menu item is checked and zero otherwise. 

 

</blockquote><p><b>备注</b></p><blockquote>



Use <a href="setmenuitemstate.html">SetMenuItemState()</a> to change the state of a menu item. 

 

</blockquote><p><b>示例</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">If</font></b> <font color="#3A3966">OpenWindow</font>(0, 200, 200, 200, 100, "GetMenuItemState Example")
    <b><font color="#3A3966">If</font></b> <font color="#3A3966">CreateMenu</font>(0,<font color="#3A3966"> WindowID</font>(0))
<font color="#3A3966">      MenuTitle</font>("Project")
<font color="#3A3966">        MenuItem</font>(1, "Changed")
<font color="#3A3966">        SetMenuItemState</font>(0, 1, 1)        <font color="#3A3966">; set check mark for the previously created menu item</font>
    <b><font color="#3A3966">EndIf</font></b>
    <b><font color="#3A3966">Repeat</font></b>
      Event =<font color="#3A3966"> WaitWindowEvent</font>()          <font color="#3A3966">; wait for an event</font>
      <b><font color="#3A3966">If</font></b> Event = <font color="#924B72">#PB_Event_Menu</font>          <font color="#3A3966">; a menu event appeared</font>
        <b><font color="#3A3966">If</font></b> <font color="#3A3966">EventMenu</font>() = 1               <font color="#3A3966">; first menu item was clicked</font>
          <b><font color="#3A3966">If</font></b> <font color="#3A3966">GetMenuItemState</font>(0, 1) = 1  <font color="#3A3966">; actual item state = check marked</font>
<font color="#3A3966">            SetMenuItemState</font>(0, 1, 0)    <font color="#3A3966">; now remove the check mark</font>
          <b><font color="#3A3966">Else</font></b>                           <font color="#3A3966">; actual item state = no check mark</font>
<font color="#3A3966">            SetMenuItemState</font>(0, 1, 1)    <font color="#3A3966">; now set the check mark</font>
          <b><font color="#3A3966">EndIf</font></b>
        <b><font color="#3A3966">EndIf</font></b>
      <b><font color="#3A3966">EndIf</font></b>
    <b><font color="#3A3966">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="setmenuitemstate.html">SetMenuItemState()</a>, <a href="getmenuitemtext.html">GetMenuItemText()</a>, <a href="menuitem.html">MenuItem()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=freemenu.html>FreeMenu()</a> - <a href="index.html">Menu Index</a> - <a href="getmenuitemtext.html">GetMenuItemText()</a> -&gt;<br><br>

</body></html>